package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RequiredArgsConstructor
@RestController("workerWorkerCertificationAuditController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 服务人员认证审核相关接口")
public class WorkerCertificationAuditController {
    private final IWorkerCertificationAuditService workerCertificationAuditService;
    /**
     * 服务人员认证申请
     *
     * @param workerCertificationAuditAddReqDTO
     */
    @ApiOperation( "服务端 - 服务人员认证申请接口")
    @PostMapping
    public void applyCertification(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO) {
        workerCertificationAuditService.applyCertification(workerCertificationAuditAddReqDTO);
    }

    /**
     * 获取认证驳回原因
     *
     * @return
     */
    @GetMapping("/rejectReason")
    @ApiOperation("获取认证驳回原因")
    public RejectReasonResDTO queryCurrentUserLastRejectReason() {
        return workerCertificationAuditService.queryCurrentUserLastRejectReason();
    }

}
